home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1995 June: Reference Library / Dev.CD Jun 95 / Dev.CD Jun 95.toast / What's New? / Tool Chest / Interfaces / UniversalInterfaces 2.0 / PInterfaces / CTBUtilities.p < prev    next >
Encoding:
Text File  |  1995-04-18  |  5.5 KB  |  230 lines  |  [TEXT/MPS ]

  1. {
  2.      File:        CTBUtilities.p
  3.  
  4.      Contains:    Communications Toolbox Utilities interfaces.
  5.  
  6.      Version:    Technology:    System 7.5
  7.                  Package:    Universal Interfaces 2.0 in “MPW Latest” on ETO #17
  8.  
  9.      Copyright:    © 1984-1995 by Apple Computer, Inc.
  10.                  All rights reserved.
  11.  
  12.      Bugs?:        If you find a problem with this file, use the Apple Bug Reporter
  13.                  stack.  Include the file and version information (from above)
  14.                  in the problem description and send to:
  15.                      Internet:    apple.bugs@applelink.apple.com
  16.                      AppleLink:    APPLE.BUGS
  17.  
  18. }
  19.  
  20. {$IFC UNDEFINED UsingIncludes}
  21. {$SETC UsingIncludes := 0}
  22. {$ENDC}
  23.  
  24. {$IFC NOT UsingIncludes}
  25.  UNIT CTBUtilities;
  26.  INTERFACE
  27. {$ENDC}
  28.  
  29. {$IFC UNDEFINED __CTBUTILITIES__}
  30. {$SETC __CTBUTILITIES__ := 1}
  31.  
  32. {$I+}
  33. {$SETC CTBUtilitiesIncludes := UsingIncludes}
  34. {$SETC UsingIncludes := 1}
  35.  
  36.  
  37. {$IFC UNDEFINED __MEMORY__}
  38. {$I Memory.p}
  39. {$ENDC}
  40. {    Types.p                                                        }
  41. {        ConditionalMacros.p                                        }
  42. {    MixedMode.p                                                    }
  43.  
  44. {$IFC UNDEFINED __DIALOGS__}
  45. {$I Dialogs.p}
  46. {$ENDC}
  47. {    Errors.p                                                    }
  48. {    Windows.p                                                    }
  49. {        Quickdraw.p                                                }
  50. {            QuickdrawText.p                                        }
  51. {        Events.p                                                }
  52. {            OSUtils.p                                            }
  53. {        Controls.p                                                }
  54. {            Menus.p                                                }
  55. {    TextEdit.p                                                    }
  56.  
  57. {$IFC UNDEFINED __STANDARDFILE__}
  58. {$I StandardFile.p}
  59. {$ENDC}
  60. {    Files.p                                                        }
  61.  
  62. {$IFC UNDEFINED __APPLETALK__}
  63. {$I AppleTalk.p}
  64. {$ENDC}
  65.  
  66. {$PUSH}
  67. {$ALIGN MAC68K}
  68. {$LibExport+}
  69.  
  70. CONST
  71. {    version of Comm Toolbox Utilities    }
  72.     curCTBUVersion                = 2;
  73. {    Error codes/types    }
  74.     ctbuGenericError            = -1;
  75.     ctbuNoErr                    = 0;
  76.  
  77.     
  78. TYPE
  79.     CTBUErr = OSErr;
  80.  
  81.  
  82. CONST
  83.     chooseDisaster                = -2;
  84.     chooseFailed                = -1;
  85.     chooseAborted                = 0;
  86.     chooseOKMinor                = 1;
  87.     chooseOKMajor                = 2;
  88.     chooseCancel                = 3;
  89.  
  90.     
  91. TYPE
  92.     ChooseReturnCode = INTEGER;
  93.  
  94.  
  95. CONST
  96.     nlOk                        = 0;
  97.     nlCancel                    = 1;
  98.     nlEject                        = 2;
  99.  
  100.     
  101. TYPE
  102.     NuLookupReturnCode = INTEGER;
  103.  
  104.  
  105. CONST
  106.     nameInclude                    = 1;
  107.     nameDisable                    = 2;
  108.     nameReject                    = 3;
  109.  
  110.     
  111. TYPE
  112.     NameFilterReturnCode = INTEGER;
  113.  
  114.  
  115. CONST
  116.     zoneInclude                    = 1;
  117.     zoneDisable                    = 2;
  118.     zoneReject                    = 3;
  119.  
  120.     
  121. TYPE
  122.     ZoneFilterReturnCode = INTEGER;
  123.  
  124.     DialogHookProcPtr = ProcPtr;  { FUNCTION DialogHook(item: INTEGER; theDialog: DialogPtr): INTEGER; }
  125.     DialogHookUPP = UniversalProcPtr;
  126.  
  127. CONST
  128.     uppDialogHookProcInfo = $000003A0; { FUNCTION (2 byte param, 4 byte param): 2 byte result; }
  129.  
  130. FUNCTION NewDialogHookProc(userRoutine: DialogHookProcPtr): DialogHookUPP;
  131.     {$IFC NOT GENERATINGCFM }
  132.     INLINE $2E9F;
  133.     {$ENDC}
  134.  
  135. FUNCTION CallDialogHookProc(item: INTEGER; theDialog: DialogPtr; userRoutine: DialogHookUPP): INTEGER;
  136.     {$IFC NOT GENERATINGCFM}
  137.     INLINE $205F, $4E90;
  138.     {$ENDC}
  139.  
  140. CONST
  141. {    Values for hookProc items        }
  142.     hookOK                        = 1;
  143.     hookCancel                    = 2;
  144.     hookOutline                    = 3;
  145.     hookTitle                    = 4;
  146.     hookItemList                = 5;
  147.     hookZoneTitle                = 6;
  148.     hookZoneList                = 7;
  149.     hookLine                    = 8;
  150.     hookVersion                    = 9;
  151.     hookReserved1                = 10;
  152.     hookReserved2                = 11;
  153.     hookReserved3                = 12;
  154.     hookReserved4                = 13;
  155. {    "virtual" hookProc items    }
  156.     hookNull                    = 100;
  157.     hookItemRefresh                = 101;
  158.     hookZoneRefresh                = 102;
  159.     hookEject                    = 103;
  160.     hookPreflight                = 104;
  161.     hookPostflight                = 105;
  162.     hookKeyBase                    = 1000;
  163.  
  164. {    NuLookup structures/constants    }
  165.  
  166. TYPE
  167.     NLTypeEntry = RECORD
  168.         hIcon:                    Handle;
  169.         typeStr:                Str32;
  170.     END;
  171.  
  172.     NLType = ARRAY [0..3] OF NLTypeEntry;
  173.  
  174.     NBPReply = RECORD
  175.         theEntity:                EntityName;
  176.         theAddr:                AddrBlock;
  177.     END;
  178.  
  179.     NameFilterProcPtr = ProcPtr;  { FUNCTION NameFilter(VAR theEntity: EntityName): INTEGER; }
  180.     NameFilterUPP = UniversalProcPtr;
  181.  
  182. CONST
  183.     uppNameFilterProcInfo = $000000E0; { FUNCTION (4 byte param): 2 byte result; }
  184.  
  185. FUNCTION NewNameFilterProc(userRoutine: NameFilterProcPtr): NameFilterUPP;
  186.     {$IFC NOT GENERATINGCFM }
  187.     INLINE $2E9F;
  188.     {$ENDC}
  189.  
  190. FUNCTION CallNameFilterProc(VAR theEntity: EntityName; userRoutine: NameFilterUPP): INTEGER;
  191.     {$IFC NOT GENERATINGCFM}
  192.     INLINE $205F, $4E90;
  193.     {$ENDC}
  194. TYPE
  195.     ZoneFilterProcPtr = ProcPtr;  { FUNCTION ZoneFilter(theZone: ConstStr32Param): INTEGER; }
  196.     ZoneFilterUPP = UniversalProcPtr;
  197.  
  198. CONST
  199.     uppZoneFilterProcInfo = $000000E0; { FUNCTION (4 byte param): 2 byte result; }
  200.  
  201. FUNCTION NewZoneFilterProc(userRoutine: ZoneFilterProcPtr): ZoneFilterUPP;
  202.     {$IFC NOT GENERATINGCFM }
  203.     INLINE $2E9F;
  204.     {$ENDC}
  205.  
  206. FUNCTION CallZoneFilterProc(theZone: ConstStr32Param; userRoutine: ZoneFilterUPP): INTEGER;
  207.     {$IFC NOT GENERATINGCFM}
  208.     INLINE $205F, $4E90;
  209.     {$ENDC}
  210.  
  211. FUNCTION InitCTBUtilities: CTBUErr;
  212. FUNCTION CTBGetCTBVersion: INTEGER;
  213. FUNCTION StandardNBP(where: Point; prompt: ConstStr255Param; numTypes: INTEGER; VAR typeList: NLType; nameFilter: NameFilterUPP; zoneFilter: ZoneFilterUPP; hook: DialogHookUPP; VAR theReply: NBPReply): INTEGER;
  214. FUNCTION CustomNBP(where: Point; prompt: ConstStr255Param; numTypes: INTEGER; VAR typeList: NLType; nameFilter: NameFilterUPP; zoneFilter: ZoneFilterUPP; hook: DialogHookUPP; userData: LONGINT; dialogID: INTEGER; filter: ModalFilterUPP; VAR theReply: NBPReply): INTEGER;
  215. {$IFC OLDROUTINENAMES }
  216. FUNCTION NuLookup(where: Point; prompt: ConstStr255Param; numTypes: INTEGER; VAR typeList: NLType; nameFilter: NameFilterUPP; zoneFilter: ZoneFilterUPP; hook: DialogHookUPP; VAR theReply: NBPReply): INTEGER;
  217. FUNCTION NuPLookup(where: Point; prompt: ConstStr255Param; numTypes: INTEGER; VAR typeList: NLType; nameFilter: NameFilterUPP; zoneFilter: ZoneFilterUPP; hook: DialogHookUPP; userData: LONGINT; dialogID: INTEGER; filter: ModalFilterUPP; VAR theReply: NBPReply): INTEGER;
  218. {$ENDC}
  219.  
  220. {$ALIGN RESET}
  221. {$POP}
  222.  
  223. {$SETC UsingIncludes := CTBUtilitiesIncludes}
  224.  
  225. {$ENDC} {__CTBUTILITIES__}
  226.  
  227. {$IFC NOT UsingIncludes}
  228.  END.
  229. {$ENDC}
  230.